package com.lb.bs.demo.config;

import com.lb.bs.client.adapter.enums.SerializeType;
import com.lb.bs.client.adapter.spring.SpringStarter;
import com.lb.bs.client.config.StaticConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * program: LB-BS-Client
 * author: bsworld.xie
 * create: 2019-11-28 19:12
 * description:
 */
@Configuration()
@EnableAspectJAutoProxy
public class Confuigration {

    @Bean("springStarter")
    public SpringStarter newLbSecondBean() {
        SpringStarter start = new SpringStarter();

        StaticConfig staticConfig = StaticConfig.builder()
                .zkHost("127.0.0.1:2181")
                .scanPackages("com.lb.bs.demo")
                .serializeType(SerializeType.COMMON)
                .build();

        start.appendStaticConfig(staticConfig);
        return start;
    }
}
